<script>
	import store from './store/index'
	export default {
		onLaunch: function() {
			console.log('App Launch')
			store.dispatch('config/getConfig').then(res => {
				console.log('配置信息:', res)
			}).catch(err => {
				console.error('获取配置失败:', err)
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	/* 全局样式 */
	page {
		font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
			Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei',
			sans-serif;
		background-color: #f8f8f8;
	}

	/* 去除按钮默认样式 */
	button {
		background: none;
		padding: 0;
		margin: 0;
		line-height: inherit;
		border-radius: 0;
		
		&::after {
			border: none;
		}
	}

	/* 去除滚动条 */
	::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
		color: transparent;
	}

	/* 文本溢出省略号 */
	.text-ellipsis {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* 主题色 */
	.theme-color {
		color: #35ae91;
	}

	.theme-bg {
		background-color: #35ae91;
	}

	/* 通用间距 */
	.mt-10 { margin-top: 10rpx; }
	.mt-20 { margin-top: 20rpx; }
	.mt-30 { margin-top: 30rpx; }
	.mb-10 { margin-bottom: 10rpx; }
	.mb-20 { margin-bottom: 20rpx; }
	.mb-30 { margin-bottom: 30rpx; }
	.ml-10 { margin-left: 10rpx; }
	.ml-20 { margin-left: 20rpx; }
	.ml-30 { margin-left: 30rpx; }
	.mr-10 { margin-right: 10rpx; }
	.mr-20 { margin-right: 20rpx; }
	.mr-30 { margin-right: 30rpx; }

	/* 通用flex布局 */
	.flex {
		display: flex;
	}

	.flex-col {
		display: flex;
		flex-direction: column;
	}

	.items-center {
		align-items: center;
	}

	.justify-center {
		justify-content: center;
	}

	.justify-between {
		justify-content: space-between;
	}

	.flex-1 {
		flex: 1;
	}

	/* 通用阴影 */
	.shadow {
		box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
	}

	/* 通用圆角 */
	.rounded {
		border-radius: 12rpx;
	}

	.rounded-full {
		border-radius: 999rpx;
	}
</style>
